﻿CREATE TABLE [dbo].[Trade]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
    [OrderId] INT NULL, 
    [TradeType] TINYINT NULL, 
    [Amount] DECIMAL(5) NULL, 
    [PayWay] TINYINT NULL, 
    [Integral] INT NULL, 
    [wallet] DECIMAL(5, 2) NULL, 
    [OnlinePay] DECIMAL(5, 2) NULL, 
    [ApplyDate] NCHAR(10) NULL, 
    [ResponseDate] NCHAR(10) NULL, 
    [State] TINYINT NULL
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'交易类型 1=支付；2=退款',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'TradeType'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'支付方式或退款方式 1=支付宝，2微信，3，银联，4，纯积分',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'PayWay'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'钱包支付金额，单位为分',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'wallet'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'在线支付金额',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'OnlinePay'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'提交支付/退款时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'ApplyDate'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'成功相应支付/退款时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'ResponseDate'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'状态 ：1=提交交易 ；交易成功；3交易失败',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'Trade',
    @level2type = N'COLUMN',
    @level2name = N'State'